'''
  @Description      
  @auther         leizi
  @create          2020-02-09 14:55
'''
from until.runMaixcmmond import runcmd
from until.readmonkeylog import read_file
from until.makereport import makereport
from until.readphone import getPhoneInfo, AndroidDebugBridge
from config.useconfig import testapkname
import os
from until.log import LOG

if __name__ == "__main__":
    path = os.getcwd() + "/crashlog/"
    andr = AndroidDebugBridge()
    devclist = andr.attached_devices()
    if len(devclist) >= 0:
        LOG.info("开始测试")
        reslut = getPhoneInfo(devclist[0])
        runcmd("10", devclist[0], path, "proeformnts.txt", testapkname)
        caozuo_num, run_activity, log_reslut = read_file(os.getcwd() + "/report.txt")
        makereport(caozuo_num, run_activity, log_reslut, "2.2.2")
    LOG.info("没有链接设备，链接设备后才可以正常测试")
